import Vue from 'vue'
import App from './App.vue'
import router from './router/main.js'
import store from './store'
import i18n from './lang';

import FastClick from 'fastclick'; // 引入插件
// 引入全局注册组件
import './components';

// 全局引入vant组件
import '@/plugins/vant.js';
// 全局引入 Reset-css
import 'reset-css';
// 全局过滤器
import '@/filters/index.js';
import api from "api/api.js";
Vue.prototype.$api = api;
Vue.config.productionTip = false;
//  开启调试
if (process.env.NODE_ENV == 'test') {
	var VConsole = require('vconsole/dist/vconsole.min.js');
	var vConsole = new VConsole();
}


// 解决移动端点击延迟200ms的问题
if ('addEventListener' in document) {
	document.addEventListener('DOMContentLoaded', function () {
		FastClick.attach(document.body);
	}, false);
}


new Vue({
	router,
	store,
	i18n,  //注入根目录下
	render: h => h(App),
	mounted() {
		// 触发renderAfterDocumentEvent
		document.dispatchEvent(new Event('render-event'))
	}
}).$mount('#app');
